function [W, P] = initWeight(X, Y, hiddenLayer)
% 初始化参数和偏导矩阵%, 隐藏层单元数等于输入层单元数, 全连接
% input:
%     hidden_layer: scalar, number of hidden layer
% output:
%     W: matrix cell array, weigth
%     P: matrix cell array, partial
    n1 = size(X, 2);
    n2 = size(Y, 2);
    for k = 1: hiddenLayer
        W{k} = rand(n1, n1 + 1) - 0.5;
        P{k} = zeros(n1, n1 + 1);
    end
    W{k + 1} = rand(n2, n1 + 1) - 0.5;
    P{k + 1} = zeros(n1, n1 + 1);
end